package com.iotimc.networklibrary;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.iotimc.networklibrary.core.BaseObserver;
import com.iotimc.networklibrary.core.HttpRetrofitFactory;
import com.iotimc.networklibrary.entity.Result2;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by david on 2017/9/15.
 *
 * @author  david
 */

public class Test {
    void main(Context context){
        Map<String, String> params = new HashMap<>(2);
        params.put("type", "APK");
        params.put("billtype", "S");
        Map<String, String> realParams = new HashMap<>(1);
        realParams.put("json", "{\"data\":" + "{\"filter\":" + JSON.toJSONString(params) + "}" + "}");
        HttpRetrofitFactory.getInstance().getResultToListEntity
                ("http://192.168.8.16:8280/terminal/system.do?action=getFileDetailList"
                , realParams.get("json"), new BaseObserver<Result2>(context,true) {
                    @Override
                    protected void onHandleSuccess(Result2 result2) {

                    }

                    @Override
                    protected void onHandleError(String msg) {

                    }
                });
    }
}
